package com.third.bank.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 交易记录表
 */
@ApiModel(description = "交易记录表")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("transaction_records")
public class TransactionRecords {

    //交易记录ID
    @ApiModelProperty("交易记录ID")
    private Long id;

    //用户ID
    @ApiModelProperty("用户ID")
    @TableField("user_id")
    private Long userId;

    //交易时间
    @ApiModelProperty("交易时间")
    @TableField("transaction_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime transactionTime;

    //业务类型（1-存款、2-取款、3-转账、4-利息结算）
    @ApiModelProperty("业务类型（1-存款、2-取款、3-转账、4-利息结算）")
    @TableField("business_type")
    private Integer businessType;

    //交易金额
    @ApiModelProperty("交易金额")
    @TableField("transaction_amount")
    private BigDecimal transactionAmount;

    //交易后余额
    @ApiModelProperty("交易后余额")
    @TableField("after_balance")
    private BigDecimal afterBalance;

    //交易对方名称
    @ApiModelProperty("交易对方名称")
    @TableField("counterpart_name")
    private String counterpartName;

    //交易对方账户
    @ApiModelProperty("交易对方账户")
    @TableField("counterpart_account")
    private String counterpartAccount;

    //创建时间
    @ApiModelProperty("创建时间")
    @TableField("created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime createdTime;
}
